<template>
  <div class="about">
    <h1>This is an about page</h1>
    <h1>
      <router-link to="/detail?id=aboutTodetail">get跳转传值,转到detail</router-link>
    </h1>
    <h1>
      <router-link :to="{name:'Detail',query:{id:123}}">命名跳转传值,转到detail</router-link>
    </h1>
    <h1 @click="click()">
      事件(导入的router)跳转传值,动态路由，转到detail
    </h1>
    <h1 @click="click2()">
      事件(vuecomponet)跳转传值,转到detail
    </h1>
  </div>
</template>
<script>
import router from '../router/index'
    export default {
        methods: {
          click(){
            router.push({ name: 'Detail', params: { id: '123' }})
          },
          click2(){
            this.$router.push({ name: 'Detail', query: { userId: '123' }})
          },
        },
    }
</script>

<style scoped>

</style>